package com.kexilo.core.security.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 系统访问记录表 kx_log_login
 * 
 * @author Kexilo
 */
@TableName("kx_log_login")
public class SysLogininfor implements Serializable {
    
    private static final long serialVersionUID = 1L;

    /** 访问ID */
    @TableId(type = IdType.AUTO)
    private Long infoId;

    /** 登录账号 */
    private String userName;

    /** 登录IP地址 */
    private String ipaddr;

    /** 登录地点 */
    private String loginLocation;

    /** 浏览器类型 */
    private String browser;

    /** 操作系统 */
    private String os;

    /** 登录状态（0成功 1失败） */
    private String status;

    /** 提示消息 */
    private String msg;

    /** 访问时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime loginTime;

    /** 用户代理信息 */
    private String userAgent;

    /** 设备类型 */
    private String deviceType;

    /** 设备指纹 */
    private String deviceFingerprint;

    /** 会话ID */
    private String sessionId;

    /** 链路追踪ID */
    private String traceId;

    /** 租户ID */
    private String tenantId;

    /** 登录类型（1:用户名密码 2:手机验证码 3:第三方登录） */
    private String loginType;

    /** 风险评分 */
    private Integer riskScore;

    /** 是否异地登录 */
    private Boolean remoteLogin;

    /** 是否新设备登录 */
    private Boolean newDevice;

    /** 认证因子（单因子/双因子） */
    private String authFactor;

    /** 失败原因代码 */
    private String failureCode;

    /** 登录耗时（毫秒） */
    private Long duration;

    // Getter methods
    public Long getInfoId() {
        return infoId;
    }

    public String getUserName() {
        return userName;
    }

    public String getIpaddr() {
        return ipaddr;
    }

    public String getLoginLocation() {
        return loginLocation;
    }

    public String getBrowser() {
        return browser;
    }

    public String getOs() {
        return os;
    }

    public String getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

    public LocalDateTime getLoginTime() {
        return loginTime;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public String getDeviceFingerprint() {
        return deviceFingerprint;
    }

    public String getSessionId() {
        return sessionId;
    }

    public String getTraceId() {
        return traceId;
    }

    public String getTenantId() {
        return tenantId;
    }

    public String getLoginType() {
        return loginType;
    }

    public Integer getRiskScore() {
        return riskScore;
    }

    public Boolean getRemoteLogin() {
        return remoteLogin;
    }

    public Boolean getNewDevice() {
        return newDevice;
    }

    public String getAuthFactor() {
        return authFactor;
    }

    public String getFailureCode() {
        return failureCode;
    }

    public Long getDuration() {
        return duration;
    }

    // Setter methods
    public void setInfoId(Long infoId) {
        this.infoId = infoId;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setIpaddr(String ipaddr) {
        this.ipaddr = ipaddr;
    }

    public void setLoginLocation(String loginLocation) {
        this.loginLocation = loginLocation;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setLoginTime(LocalDateTime loginTime) {
        this.loginTime = loginTime;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public void setDeviceFingerprint(String deviceFingerprint) {
        this.deviceFingerprint = deviceFingerprint;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }

    public void setRiskScore(Integer riskScore) {
        this.riskScore = riskScore;
    }

    public void setRemoteLogin(Boolean remoteLogin) {
        this.remoteLogin = remoteLogin;
    }

    public void setNewDevice(Boolean newDevice) {
        this.newDevice = newDevice;
    }

    public void setAuthFactor(String authFactor) {
        this.authFactor = authFactor;
    }

    public void setFailureCode(String failureCode) {
        this.failureCode = failureCode;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }
}
